<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title></title>
<asset:stylesheet rel="stylesheet" href="home/css/sharefolder.css" />
<%--<asset:stylesheet rel="stylesheet" href="home/css/font-awesome.min.css" />

--%>
<asset:stylesheet rel="stylesheet" href="font-awesome-4.3.0/css/font-awesome.min.css" />
<link href='http://fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Raleway:400,300,700' rel='stylesheet' type='text/css'>
<%--<asset:javascript src="home/js/bootstrap.min.js"/>
--%><asset:stylesheet rel="stylesheet" href="home/css/photo/photoswipe.css" />
<asset:stylesheet rel="stylesheet" href="home/css/photo/default-skin/default-skin.css" />
<asset:javascript src="lib/jquery.min.1.9.1.js"/>
<asset:javascript src="home/js/jquery.cookie.js"/>
<asset:javascript src="js/share/gridListView.js"/>
<asset:stylesheet rel="stylesheet" href="home/css/animate.css"/>
<asset:stylesheet rel="stylesheet" href="home/css/manageTableShare.css" />	
<!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    
<asset:javascript src="js/share/hmac-sha1.js"/>
<asset:javascript src="js/share/enc-base64-min.js"/>
<asset:javascript src="js/share/synchronize.js"/>


</head>

<body data-spy="scroll" data-offset="0" data-target="#navbar-main">
<div id="navbar-main"> 
  <!-- Fixed navbar -->
  <div class="headernavigate navbar navbar-inverse navbar-fixed-top">
    <div class="container">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
       	<asset:image  src="main/cloudsharing.png" style="height:46px" />
        </div>
      <div class="navbar-collapse collapse">
        <ul class="nav navbar-nav navbar-right">
          <li class=""><a href="#"  class="smoothScroll navtitle">Login</a></li>
          <li class="cssLeft"> <a href="#" class="smoothScroll navtitle">Sign up</a></li>
        </ul>
      </div>
      <!--/.nav-collapse --> 
    </div>
  </div>
</div>


<div id="services" name="services">
  <div class="container">
    <div class="row">
    <%--
      <h2 class="centered">Share Service</h2>
      <hr>
      --%><div class="col-lg-8 col-lg-offset-2">
      <input type="hidden" name ="folderPath" value="${folderPath}"/>
      <input type="hidden" name ="folderOwner" value="${folderOwner}"/>
      
    	<g:render template="/folder/manageTable"></g:render>
    	
      </div>
    </div>
  </div>
</div>

<div id="footerwrap">
  <div class="container">
    <div class="row">	
      <div class="col-md-8"> <span class="copyright">Copyright &copy; 2015 CloudSharing. Design by <a class="noUnderline" href="http://www.zingpoll.com" rel="nofollow">Graduation Thesis Team</a></span> </div>
      <div class="col-md-4">
      </div>
    </div>
  </div>
</div>
<asset:javascript src="js/share/animatedModal.js"/>
<asset:javascript src="js/share/managetable.js"/>
<asset:javascript src="js/share/viewfile.js"/>
<script type="text/javascript">


function analyzeImagesType(documentType,documentName,urlFile){

	var documentType = parseInt(documentType);
	var documentExtension = getFileExtension(documentName);
	var documentImage = '';
	
	if(documentType == 0){
		 documentImage = '<asset:image class="customeimg foldersimulate" src="sharemanager/folder.png" />';
	}

	else {
		switch (documentExtension){
			case 'doc': documentImage = '<asset:image class="customeimg simulate" src="sharemanager/doc.png" />'; break;
			case 'pdf': documentImage = '<asset:image class="customeimg simulate" src="sharemanager/infographics.png" />'; break;
			case 'xls': documentImage = '<asset:image class="customeimg simulate" src="sharemanager/xls.png" />'; break; 
			case 'odt': documentImage = '<asset:image class="customeimg simulate" src="sharemanager/doc.png" />'; break;
			case 'ppt': documentImage = '<asset:image class="customeimg simulate" src="sharemanager/infographics.png" />'; break;
			case 'rar': documentImage = '<asset:image class="customeimg simulate" src="sharemanager/zip.png" />'; break;
			case 'zip': documentImage = '<asset:image class="customeimg simulate" src="sharemanager/zip.png" />'; break;
			case 'png': documentImage = '<image class="customeimg simulate" src="'+urlFile+'" />'; break;
			case 'txt': documentImage = '<asset:image class="customeimg simulate" src="sharemanager/txt.png" />'; break;
			case 'jpg': documentImage = '<image class="customeimg simulate" src="'+urlFile+'" />'; break;
			case 'jpeg': documentImage = '<image class="customeimg simulate" src="'+urlFile+'" />'; break;
			case 'jpg': documentImage = '<image class="customeimg simulate" src="'+urlFile+'" />'; break;
			case 'avi': documentImage = '<asset:image class="customeimg simulate" src="sharemanager/video.png" />'; break;
			case 'mp3': documentImage = '<asset:image class="customeimg simulate" src="sharemanager/music.png" />'; break;
			default : documentImage = '<asset:image class="customeimg simulate" src="sharemanager/file.png" />';
		}

	}

	return documentImage;
}	


</script>

<g:javascript>
function getParameter(sParam)
{
    var sPageURL = window.location.search.substring(1);
    var sURLVariables = sPageURL.split('&');
    for (var i = 0; i < sURLVariables.length; i++) 
    {
        var sParameterName = sURLVariables[i].split('=');
        if (sParameterName[0] == sParam) 
        {
            return sParameterName[1];
        }
    }
    return "undefined"
}
$(document).ready(function(){
	
	var result = unescape('${data}');
	result = result.split(",");
	var resultName = result[0].split(":");
	var folderName = resultName[1].slice(1,resultName[1].length-1);
	var resultPath = result[1].split(":");
	var folderPath = resultPath[1].slice(1,resultPath[1].length-1);
 	var resultEmail = result[2].split(":");
	var folderOwner = resultEmail[1].slice(1,resultEmail[1].length-2);
	$('input[name="folderOwner"]').val(folderOwner);
	document.title = folderName;
	if(getParameter('path') == "undefined"){
	getRootDocuments(folderPath,folderOwner);
	}else{
		getRootDocuments(getParameter('path'),folderOwner);
	}
	
	syncDataS3(folderPath,folderOwner);
});

</g:javascript>
<input name="objectKey" type="hidden" value =""/>
</body>
</html>
